//
//  SSStatusMessage.m
//  Secret Santa
//
//  Created by Andrew Cain on 19/10/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "SSStatusMessage.h"


@implementation SSStatusMessage

- (id) init
{
	if( [super init] )
	{
		image = [NSImage imageNamed:@"Progress"];
		return self;
	}
	else return nil;
}

- (void) dealloc
{
	[image release];
	[super dealloc];
}

- (NSImage *) image
{
	return image;
}

- (NSString *) message
{
	return message;
}

- (void) setMessage: (NSString *) value
{
	if( value != message)
	{
		[self willChangeValueForKey:@"message"];
		
		[message release];
		[value retain];
		message = value;		
	}
}

- (void) setImage: (NSImage *) value
{
	if(image != value)
	{
		[self willChangeValueForKey:@"image"];
		[image release];
		[value retain];
		
		image = value;
		[self didChangeValueForKey:@"image"];
	}
}

- (void) setSuccess: (BOOL) value
{
	if(value)
	{
		[self setImage: [NSImage imageNamed: @"Success"]];
	}
	else
	{
		[self setImage: [NSImage imageNamed: @"Fail"]];
	}
}

@end
